
<!-- saved from url=(0039)https://passwords-generator.org/widget/ -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Password Generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="https://passwords-generator.org/images/favicon.ico">
<link rel="stylesheet" type="text/css" href="./Password Generator_files/style.css">
</head>
<body>
<div class="container" id="container">
<div id="error" class="error" style="display:none">Please enter a password with a minimum of 4 characters and a maximum of 2048 characters.</div>
    <table class="table table-bordered">
        <tbody><tr class="header2">
            <td colspan="2"><h2>Password Generator</h2></td>
        </tr>    
    <tr>
        <td width="40%"><span class="field_text">Password Length:</span></td>
        <td><input name="txtPasswordLength" type="text" value="16" id="txtPasswordLength" class="input-custom medium" onkeyup="generate()"></td>
    </tr>     
    <tr>
        <td><span class="field_text">Lowercase Characters:</span></td>
        <td><span onchange="generate()"><input id="chkIncludeLowerChar" type="checkbox" name="chkIncludeLowerChar" checked="checked"><label for="chkIncludeLowerChar"> (e.g. abcdef)</label></span></td>
    </tr>
    <tr>
        <td><span class="field_text">Uppercase Characters:</span></td>
        <td><span onchange="generate()"><input id="chkIncludeUpperChar" type="checkbox" name="chkIncludeUpperChar" checked="checked"><label for="chkIncludeUpperChar"> (e.g. ABCDEF)</label></span></td>
    </tr>  
    <tr>
        <td><span class="field_text">Numbers:</span></td>
        <td><span onchange="generate()"><input id="chkIncludeNumbers" type="checkbox" name="chkIncludeNumbers" checked="checked"><label for="chkIncludeNumbers"> (e.g. 123456)</label></span></td>
    </tr>       
    <tr>
        <td><span class="field_text">Symbols:</span></td>
        <td><span onchange="generate()"><input id="chkIncludeSymbols" type="checkbox" name="chkIncludeSymbols" checked="checked"><label for="chkIncludeSymbols"> (e.g. *@#+%)</label></span></td>
    </tr>
    <tr>
        <td><span class="field_text">Exclude Similar Characters:</span></td>
        <td><span onchange="generate()"><input id="chkExcludeSimilar" type="checkbox" name="chkExcludeSimilar"><label for="chkExcludeSimilar"> (e.g. o,0,i,l,1)</label></span></td>
    </tr>
    <tr>
        <td><span class="field_text">Exclude Ambiguous Characters:</span></td>
        <td><span onchange="generate()"><input id="chkExcludeAmbiguous" type="checkbox" name="chkExcludeAmbiguous"><label for="chkExcludeAmbiguous"> (e.g. ~,;:.{}&lt;&gt;[]()/\'`)</label></span></td>
    </tr>
        <tr>
            <td></td>
            <td><a onclick="generate()" class="button button-main">Generate Password</a></td>
      </tr> 
   </tbody></table>
       <table class="table table-bordered" style="table-layout:fixed">
        <tbody><tr>
            <td width="40%"><span class="field_text">Generated Password:</span></td> 
            			<td style="word-wrap: break-word"><input name="txtPassword" type="text" readonly="readonly" id="txtPassword" class="input-custom" onclick="this.setSelectionRange(0, this.value.length)" style="width:60%;">
            <a onclick="copyUrl()" class="button button-green short">Copy</a></td>
        </tr>       
    </tbody></table>   
</div>		
<script type="text/javascript">
var upperChars = ["A","B","C","D","E","F","G","H","J","K","M","N","P","Q","R","S","T","U","V","W","X","Y","Z"];
var lowerChars = ["a","b","c","d","e","f","g","h","j","k","m","n","p","q","r","s","t","u","v","w","x","y","z"];
var numbers = ["2","3","4","5","6","7","8","9"];
var symbols = ["!","#","$","%","&","*","+","-","?","@"];
var similars_lower = ["i","l","o"];
var similars_upper = ["I","L","O"];
var similars_numbers = ["1","0"];
var similars_symbols = ["|"];
var ambiguous = ["\"","'","(",")",",",".","/",":",";","<","=",">","[","\\","]","^","_","`","{","}","~"];
function generate(){
    var passwordLength = parseFloat(document.getElementById('txtPasswordLength').value);
    
    var password="";
    var isPasswordSet;
	if(!isNaN(passwordLength))
    { 
        if(passwordLength < 4 || passwordLength > 2048)
        {
            document.getElementById("error").style.display = "block";
            document.getElementById('txtPassword').value = "";
        } else {
            document.getElementById("error").style.display = "none";
            password = getPassword(passwordLength);
            document.getElementById('txtPassword').value = password;
        }
    }
}

function getPassword(passwordLength)
{
    var passwordLength = parseFloat(document.getElementById('txtPasswordLength').value);
    var chkIncludeLowerChar = document.getElementById('chkIncludeLowerChar').checked;
    var chkIncludeUpperChar = document.getElementById('chkIncludeUpperChar').checked;
    var chkIncludeNumbers = document.getElementById('chkIncludeNumbers').checked;
    var chkIncludeSymbols = document.getElementById('chkIncludeSymbols').checked;
    var chkExcludeSimilar = document.getElementById('chkExcludeSimilar').checked;
    var chkExcludeAmbiguous = document.getElementById('chkExcludeAmbiguous').checked;
    
    var password="";
    var array = [];
    var count = 0;
    if(chkIncludeLowerChar){
        array = array.concat(lowerChars);
    }
    if(chkIncludeUpperChar){
        array = array.concat(upperChars);
    }
    if(chkIncludeNumbers){
        array = array.concat(numbers);
    }
    if(chkIncludeSymbols){
       array = array.concat(symbols);
    }
    if(!chkExcludeSimilar){
        if(chkIncludeLowerChar)
        {
            array = array.concat(similars_lower);
        }
        if(chkIncludeUpperChar)
        {
            array = array.concat(similars_upper);
        }
        if(chkIncludeNumbers)
        {
            array = array.concat(similars_numbers);
        }
        if(chkIncludeSymbols)
        {
            array = array.concat(similars_symbols);
        }   
    }
    if(!chkExcludeAmbiguous && chkIncludeSymbols){
        array = array.concat(ambiguous);
    }
    var randomIndex;
    if(array.length > 1)
    {
       for (var i = 0; i < passwordLength; i++) {
           randomIndex = Math.floor(Math.random() * array.length);
           password = password + array[randomIndex];
       }
    }
    return password;
}

function copyUrl(){         
   var copyText = document.getElementById('txtPassword');
   copyText.select();
   copyText.setSelectionRange(0, 99999);
   document.execCommand("copy");
}
generate();
		window.onload = function() {
			sendPostMessage();
		};
</script>  
<script>
  var height;
  var sendPostMessage = () => {
    if (height !== document.getElementById('container').offsetHeight) {
      height = document.getElementById('container').offsetHeight;
      window.parent.postMessage({
        frameHeight: height
      }, '*');
    }
  }
  window.onresize = () => sendPostMessage();
</script> 

</body></html>